﻿using DevExpress.XtraEditors.Repository;
using eFatura.Utility;
using Extensions;
using System;
using System.Data;
using DevExpress.XtraBars;

namespace eFatura
{
    public partial class FirmaSorgulama : XForm
    {
        public FirmaSorgulama()
        {
            InitializeComponent();
        }

        private void Cari_Load(object sender, EventArgs e)
        { 
            gvMaster.Init(Schema + "GetEfaturaFirma", SirketId);
            gvMaster.AddSummary();
            gvMaster.BestFitColumns();

            MainToolbar.Visible = true;

            bbiSorgula.ItemClick += bbiSorgula_ItemClick;
        }

        void bbiSorgula_ItemClick(object sender, ItemClickEventArgs e)
        {
            Fatura f = new Fatura();
            AppSession.DataManager.ExecuteNonQuery(Schema + "JOB_Guncellemeler", SirketId);            
            f.eFaturaMukellefGuncelle(true, SirketId);

            gvMaster.VeriyiGuncelle(Schema + "GetEfaturaFirma", SirketId);
        }

        private void btnSorgula_ItemClick(object sender, ItemClickEventArgs e)
        {
            
        }
    }
}
